package com.microframework.boot.fs.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@RestController
@RequestMapping("/fs/minio")
@Tag(name = "minio文件管理", description = "minio文件相关接口")
public class MinioController {

//	@Autowired
//	private IMinioService minioService;

//	@PostMapping("/upload")
//	public String uploadFile(@RequestParam("file") MultipartFile file) throws Exception {
//		return minioService.uploadFile(file, file.getOriginalFilename());
//	}
//
//	@GetMapping("/download/{objectName}")
//	public ResponseEntity<InputStreamResource> downloadFile(@PathVariable String objectName) throws Exception {
//		var response = minioService.downloadFile(objectName);
//		return ResponseEntity.ok().contentType(MediaType.APPLICATION_OCTET_STREAM)
//				.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + objectName + "\"")
//				.body(new InputStreamResource(response));
//	}
//
//	@DeleteMapping("/delete/{objectName}")
//	public void deleteFile(@PathVariable String objectName) throws Exception {
//		minioService.deleteFile(objectName);
//	}

}
